<template>
  <view class="ver-layout">
    <view class="top-view">提交截止日期：{{ homeworkDetails.endtime }}</view>
    <view class="homework-detail ver-layout-center">
      <view class="title">作业详情</view>
      <view class="hint hor-layout-center">
        <image class="hint-icon" src="@/static/home/ic_homework_hint.png"/>
        <view class="hint-text">{{ homeworkDetails.description }}</view>
      </view>
      <view class="divider-line"></view>
      <view class="teacher-info hor-layout">
        <image class="teacher-icon" :src="homeworkDetails.material_image"/>
        <view class="ver-layout">
          <view class="info-title">{{homeworkDetails.material_title}}</view>
          <view class="info-content">{{homeworkDetails.material_description}}</view>
        </view>
      </view>
      <view class="divider-line"></view>
      <view class="teacher-homework-info hor-layout">
        <view class="title">作业说明：</view>
        <view class="content">{{homeworkDetails.description}}</view>
      </view>
    </view>
  </view>
</template>

<script>
import {StudentHomeWorkApi} from "@/api/recordStudy.js"

let engine = new StudentHomeWorkApi()
export default {
  name: "homeworkInfo",
  data() {
    return {
      homeworkObj: {},
      homeworkDetails: {}
    }
  },
  onLoad(options) {
    this.homeworkObj = options
    this.getHomeWorkDetailLayout()
  },
  methods: {
    getHomeWorkDetailLayout() {
      engine.getHomeWorkDetailLayout(this.homeworkObj.id).then(res => {
        this.homeworkDetails = res.data
      })
    }
  }
}
</script>

<style >
page {
  background: #F2F2F2;
}

.top-view {
  width: 100%;
  height: 34px;
  background: #FFFFFF;
  text-align: center;
  line-height: 34px;
  /* 文本样式 */
  font-size: 15px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #FF0000;
}

.homework-detail {
  width: 100%;
  padding: 0px 12px;
  padding-top: 18px;
  margin-top: 18px;
  background: #FFFFFF;
}

.homework-detail > .title {
  font-size: 16px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #333333;
}

.homework-detail > .hint {
  margin-top: 18px;
  padding: 5px 13px;
  width: 100%;
  border-radius: 5px;
  background-image: linear-gradient(to right, #FF873E, #FFB43E);
}

.hint-icon {
  width: 36px;
  height: 42px;
}

.hint-text {
  margin-left: 24px;
  font-size: 12px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #FFFFFF;
  line-height: 18px;
}

.divider-line {
  margin-top: 18px;
  width: 100%;
  height: 1px;
  background: #E5E5E5;
}

.teacher-info {
  width: 100%;
  margin-top: 18px;
}

.teacher-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 12px;
}

.info-title {
  font-size: 14px;
  line-height: 14px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #333333
}

.info-content {
  margin-top: 7px;
  font-size: 10px;
  line-height: 10px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #999999;
}

.teacher-homework-info {
  width: 100%;
  margin-top: 12px;
  margin-bottom: 18px;
}

.teacher-homework-info > .title {
  flex-shrink: 0;
  font-size: 14px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #333333;
}

.teacher-homework-info > .content {
  flex: 1;
  margin-left: 12px;
  font-size: 14px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #333333;
  line-height: 18px;
}
</style>
